<template>
  <view>
    <view
      class="follow-item"
      v-for="(item, index) in listArr"
      :key="index"
      @tap="goDetail(item.id)"
    >
      <view @click.stop="goUserInfo(item.author.loginname)">
        <u-avatar class="follow-img" :src="item.author.avatar_url" />
      </view>
      <view>
        <view class="loginname">{{ item.author.loginname }}</view>
        <view class="follow-title">{{ item.title }}</view>
      </view>
    </view>
    <u-empty v-if="listArr.length === 0" text="暂无数据" mode="list"></u-empty>
  </view>
</template>

<script>
import { goUserInfo, goDetail } from "@/utils/jump.js";
export default {
  props: {
    listArr: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      goUserInfo,
      goDetail,
    };
  },
};
</script>

<style lang="scss" scoped>
.follow-item {
  display: flex;
  padding: 20rpx;
  border-bottom: 1px solid #eee;
  .loginname {
    font-weight: 700;
    color: #000;
    font-size: 28rpx;
  }
  .follow-title {
    color: #333;
    font-size: 24rpx;
    margin-top: 10rpx;
  }
  .follow-img {
    margin-right: 20rpx;
  }
}
</style>